package api.extractExpert;

import wt.entity.specific.ExtractExpert;

import java.util.ArrayList;
import java.util.List;

/**
 * 功能:
 * 作者: 洪世成
 * 日期: 2018/1/20
 * 版权所有: admin
 */
public class HandleResult {


    public static List<Result> treatmentResult(List<ExtractExpert> extractExpertList) {

        List<Result> resultList = new ArrayList<Result>();

        for (ExtractExpert extractExpert : extractExpertList) {
            Result result = new Result();
            result.setName(extractExpert.getName());
            result.setIdCard(extractExpert.getIdCard());
            result.setPhone(extractExpert.getPhone());
            result.setWorkCompany(extractExpert.getWorkCompany());
            result.setAffiliateCompany(extractExpert.getAffiliateCompany());
            result.setReviewTimes(extractExpert.getReviewTimes());
            result.setCertificateNum(extractExpert.getCertificateNum());
            result.setGrade(extractExpert.getGrade());
            result.setOutLander(extractExpert.getOutLander());
            result.setSex(extractExpert.getSex());


            if (extractExpert.getLive() == 0) {
                result.setReason("未启用");
            } else if (extractExpert.getCertificateNum() == null) {
                result.setReason("证书无效");
            } else if (extractExpert.getScheduleTimes() > 0) {
                result.setReason("已有日程安排");
            } else {
                result.setResult(true);
            }
            resultList.add(result);
        }

        return resultList;
    }
}
